package org.example.system.common.enums;

/**
 * 支付方式枚举
 */
public enum PayTypeEnum {

    WECHAT_PAY(1, "微信支付"),
    ALI_PAY(2, "支付宝支付")
    //CREDIT_CARD_PAY(3, "信用卡支付"),
    //UNION_PAY(4, "银联支付");

    ;

    private final String label;
    private final int value;

    PayTypeEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public int getValue() {
        return value;
    }

    public static PayTypeEnum fromValue(int value) {
        for (PayTypeEnum payTypeEnum : PayTypeEnum.values()) {
            if (payTypeEnum.getValue() == value) {
                return payTypeEnum;
            }
        }
        return null;
    }
}